import yaml

from yaml import SafeLoader
from datareport.api.DataSource import DataSource
from datareport.api.annotation.Font import Font
from datareport.api.enum.FontEnum import FontEnum
from datareport.impl.paragraph.base.BaseParagraph import BaseParagraph
from datareport.api.annotation.Style import style
from datareport.api.enum.ParagraphStyleEnum import ParagraphStyleEnum


@style(paragraph=ParagraphStyleEnum.LEVEL_TWO.value)
class KaiZhanQingKuang_pingci_37(BaseParagraph):
    """
    组织生活开展频次
    """
    decrease=40

    def __init__(self):
        super().__init__()
        self.text = ''
        self.fonts = [
            Font(type=FontEnum.LEVEL_TWO.value,text='''（二） 组 织 生 活 开 展 频 次 分 析''')
        ]
        self.sort = 27
        self.section = 11

    def plot(self, df, plt):
        pass

    def getData(self, result):
        pass

    def start(self, conn, year, plt):
        self.text=self.text.replace(' ','')

if __name__ == '__main__':
    with open('D:\work\sanhuiyike\datareport\config.yaml', encoding='utf-8') as f:
        data = yaml.load(f, Loader=SafeLoader)
    con=DataSource(data['datasource']).conna
    KaiZhanQingKuang_one_jiceng().start(con,2023,'')
